//
//  WebServices.h
//  GKBHouse
//
//  Created by  on 12-7-7.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ExFrame.h"
#import "ConnectTip.h"
#import "iToast.h"
#import "GKBMainController.h"
#define kConnectTipView 199
@interface MyFormDataRequest :ASIFormDataRequest 
@property (retain) id endTarget;
@property (assign) SEL endAction;
@property (retain) NSString *errorTip;
@property (assign) NSInteger index;
@end
@interface WebServices : NSObject<ASIHTTPRequestDelegate>
{
    ASINetworkQueue *networkQueue;
    ConnectTip *connectTip;

}
@property (assign) id requestTarget;
@property (assign) SEL requestAction;
@property (retain) NSString *errorTip;
@property (retain) NSMutableDictionary *queueDic;
@property (assign) NSInteger queueIndex;
@property (retain) NSMutableDictionary *requestDic;

+ (void)setShowConnectting:(BOOL)show;
+ (BOOL)showConnectting;

+ (NSURL *)url;
+ (WebServices *)webService;

- (void)cancelService;

- (void)initNetWorkQueue;
- (void)setCurrentQueue;
- (void)removeQueueIndex:(NSInteger)index;

- (void)saveRequestDic:(MyFormDataRequest *)request;
- (void)removeRequestDicIndex:(NSInteger)index;

- (void)requestDone:(MyFormDataRequest*)request;
- (void)requestWrong:(MyFormDataRequest*)request;

+ (MyFormDataRequest *)requestStartOrder:(NSString *)order body:(NSString *)json target:(id)target action:(SEL)action errorTip:(NSString *)errorTip;

- (void)addConnectTip;
- (void)removeConnectTip;

+ (void)removeRequest:(MyFormDataRequest *)request;

+ (void)requestSynStartOrder:(NSString *)order body:(NSString *)json result:(void(^)(NSDictionary * dic))result;

@end
